import request from '@/utils/request'

// 特殊情况调用开闸接口
export function getPageList(data) {
  return request({
    url: '/school/duty/getDutyPageList',
    method: 'post',
    data
  })
}

export function createOrUpdateSchoolDuty(data) {
    return request({
      url: '/school/duty/createOrUpdateSchoolDuty',
      method: 'post',
      data
    })
  }

export function deleteSchoolDutyById(data) {
    return request({
      url: '/school/duty/deleteSchoolDutyById',
      method: 'post',
      data
    })
  }

// 下载导入模板
export function importTemplate() {
  return request({
    url: '/school/duty/importTemplate',
    responseType:'blob',
    method: 'get'
  })
}
  
// 导出值班列表
export function exportDutyData(query) {
  return request({
    url: '/school/duty/exportDutyData',
    method: 'get',
    responseType:'blob',
    params: query
  })
}

// 换班
export function updateDutyUser(data) {
  return request({
    url: '/school/duty/updateDutyUser',
    method: 'post',
    data
  })
}

// 换班
export function deleteOtherMonthDuty(data) {
  return request({
    url: '/school/duty/deleteOtherMonthDuty',
    method: 'post',
    data
  })
}